home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 3 / Light ROM 3 - Disc 2.iso / programs / amiga / dps / par252.lha / rexx / CopyAll.ddr < prev    next >
Text File  |  1995-01-11  |  1KB  |  53 lines

  1. /* Program to copy all contents of one PAR drive to another */
  2. /* Needs version 2.06 of Amiga PAR */
  3. /* DD0: refers to source drive, and DD1: is slave*/
  4. /*                                               */
  5.  
  6. address DDR
  7.  
  8.  
  9. address command 'list > ram:temp DD1: LFORMAT "%s"'
  10.  
  11. file_list1 = 'ram:temp'
  12.  
  13. if open('myfile',file_list1,'READ') then do
  14.  
  15.    do while ~EOF('myfile')
  16.  
  17.       ff_name = readln('myfile')
  18. /*      address command 'makedir DD0:'||ff_name */
  19.  
  20.    end
  21.  
  22.    call close('myfile')
  23. end
  24. else
  25.     say 'no open file'
  26.  
  27. address command 'list > ram:temp DD1: LFORMAT "%P%N" all files'
  28. address command 'sort ram:temp ram:temp2'
  29. address command 'copy ram:temp2 ram:temp'
  30.  
  31. file_list  = 'ram:temp'
  32.  
  33. if open('myfile',file_list,'READ') then do
  34.  
  35.    do while ~EOF('myfile')
  36.  
  37.       ff_name = readln('myfile')
  38.       ff_name_len = length(ff_name)
  39.       f_dest_path = 'DD0:'||right(ff_name,ff_name_len-4)
  40.       dest_path_len  = index(f_dest_path,'/') - 1
  41.       dest_path = left(f_dest_path,dest_path_len)
  42.  
  43.      copy ff_name dest_path
  44.  
  45.    end
  46.  
  47.    call close('myfile')
  48.    end
  49.  
  50. else
  51.    say 'cant open file' 
  52. EXIT
  53.